using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._3DAnalystTools._3DFeatures._Extraction
{
    /// <summary>
    /// <para>Regularize Building Footprint</para>
    /// <para>Normalizes the footprint of building polygons by eliminating undesirable artifacts in their  geometry.</para>
    /// <para>通过消除几何图形中不需要的伪影来规范化建筑多边形的占用空间。</para>
    /// </summary>    
    [DisplayName("Regularize Building Footprint")]
    public class RegularizeBuildingFootprint : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public RegularizeBuildingFootprint()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The polygons that represent the building footprints to be regularized.</para>
        /// <para>表示要正则化的建筑物覆盖区的多边形。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The feature class that will be produced.</para>
        /// <para>将生成的要素类。</para>
        /// </param>
        /// <param name="_method">
        /// <para>Method</para>
        /// <para><xdoc>
        ///   <para>The regularization method to be used in processing the input features.</para>
        ///   <bulletList>
        ///     <bullet_item>Right Angles—Constructs shapes comprised of 90° angles between adjoining edges.</bullet_item><para/>
        ///     <bullet_item>Right Angles and Diagonals—Constructs shapes comprised of 45° and 90° angles between adjoining edges.</bullet_item><para/>
        ///     <bullet_item>Any Angles—Constructs shapes that form any angles between adjoining edges.</bullet_item><para/>
        ///     <bullet_item>Circle—Constructs the best fitting circle around the input features.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于处理输入要素的正则化方法。</para>
        ///   <bulletList>
        ///     <bullet_item>直角 （Right Angles） - 构造由相邻边之间的 90° 角组成的形状。</bullet_item><para/>
        ///     <bullet_item>直角和对角线 （Right Angles） - 构造由相邻边之间的 45° 和 90° 角组成的形状。</bullet_item><para/>
        ///     <bullet_item>任意角度 （Any Angles） - 构造在相邻边之间形成任意角度的形状。</bullet_item><para/>
        ///     <bullet_item>圆 - 在输入要素周围构造最佳拟合圆。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_tolerance">
        /// <para>Tolerance</para>
        /// <para>The maximum distance that the regularized footprint can deviate from the boundary of its originating feature. The specified value will be based on the linear units of the input feature's coordinate system.</para>
        /// <para>正则化封装可以偏离其原始要素边界的最大距离。指定值将基于输入要素坐标系的线性单位。</para>
        /// </param>
        public RegularizeBuildingFootprint(object _in_features, object _out_feature_class, _method_value _method, double? _tolerance)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
            this._method = _method;
            this._tolerance = _tolerance;
        }
        public override string ToolboxName => "3D Analyst Tools";

        public override string ToolName => "Regularize Building Footprint";

        public override string CallName => "3d.RegularizeBuildingFootprint";

        public override List<string> AcceptEnvironments => ["extent", "geographicTransformations", "gpuID", "outputCoordinateSystem", "parallelProcessingFactor", "processorType", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _method.GetGPValue(), _tolerance, _densification, _precision, _diagonal_penalty, _min_radius, _max_radius];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The polygons that represent the building footprints to be regularized.</para>
        /// <para>表示要正则化的建筑物覆盖区的多边形。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The feature class that will be produced.</para>
        /// <para>将生成的要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Method</para>
        /// <para><xdoc>
        ///   <para>The regularization method to be used in processing the input features.</para>
        ///   <bulletList>
        ///     <bullet_item>Right Angles—Constructs shapes comprised of 90° angles between adjoining edges.</bullet_item><para/>
        ///     <bullet_item>Right Angles and Diagonals—Constructs shapes comprised of 45° and 90° angles between adjoining edges.</bullet_item><para/>
        ///     <bullet_item>Any Angles—Constructs shapes that form any angles between adjoining edges.</bullet_item><para/>
        ///     <bullet_item>Circle—Constructs the best fitting circle around the input features.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于处理输入要素的正则化方法。</para>
        ///   <bulletList>
        ///     <bullet_item>直角 （Right Angles） - 构造由相邻边之间的 90° 角组成的形状。</bullet_item><para/>
        ///     <bullet_item>直角和对角线 （Right Angles） - 构造由相邻边之间的 45° 和 90° 角组成的形状。</bullet_item><para/>
        ///     <bullet_item>任意角度 （Any Angles） - 构造在相邻边之间形成任意角度的形状。</bullet_item><para/>
        ///     <bullet_item>圆 - 在输入要素周围构造最佳拟合圆。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Method")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _method_value _method { get; set; }

        public enum _method_value
        {
            /// <summary>
            /// <para>Right Angles</para>
            /// <para>Right Angles—Constructs shapes comprised of 90° angles between adjoining edges.</para>
            /// <para>直角 （Right Angles） - 构造由相邻边之间的 90° 角组成的形状。</para>
            /// </summary>
            [Description("Right Angles")]
            [GPEnumValue("RIGHT_ANGLES")]
            _RIGHT_ANGLES,

            /// <summary>
            /// <para>Right Angles and Diagonals</para>
            /// <para>Right Angles and Diagonals—Constructs shapes comprised of 45° and 90° angles between adjoining edges.</para>
            /// <para>直角和对角线 （Right Angles） - 构造由相邻边之间的 45° 和 90° 角组成的形状。</para>
            /// </summary>
            [Description("Right Angles and Diagonals")]
            [GPEnumValue("RIGHT_ANGLES_AND_DIAGONALS")]
            _RIGHT_ANGLES_AND_DIAGONALS,

            /// <summary>
            /// <para>Any Angles</para>
            /// <para>Any Angles—Constructs shapes that form any angles between adjoining edges.</para>
            /// <para>任意角度 （Any Angles） - 构造在相邻边之间形成任意角度的形状。</para>
            /// </summary>
            [Description("Any Angles")]
            [GPEnumValue("ANY_ANGLE")]
            _ANY_ANGLE,

            /// <summary>
            /// <para>Circle</para>
            /// <para>Circle—Constructs the best fitting circle around the input features.</para>
            /// <para>圆 - 在输入要素周围构造最佳拟合圆。</para>
            /// </summary>
            [Description("Circle")]
            [GPEnumValue("CIRCLE")]
            _CIRCLE,

        }

        /// <summary>
        /// <para>Tolerance</para>
        /// <para>The maximum distance that the regularized footprint can deviate from the boundary of its originating feature. The specified value will be based on the linear units of the input feature's coordinate system.</para>
        /// <para>正则化封装可以偏离其原始要素边界的最大距离。指定值将基于输入要素坐标系的线性单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public double? _tolerance { get; set; }


        /// <summary>
        /// <para>Densification</para>
        /// <para><xdoc>
        ///   <para>The sampling interval that will be used to evaluate whether the regularized feature will be straight or bent. The densification must be equal to or less than the tolerance value.</para>
        ///   <para>This parameter is only used with methods that support right angle identification.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将用于评估正则化特征是直线还是弯曲的采样间隔。致密化必须等于或小于公差值。</para>
        ///   <para>此参数仅用于支持直角识别的方法。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Densification")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _densification { get; set; } = null;


        /// <summary>
        /// <para>Precision</para>
        /// <para>The precision of the spatial grid used in the regularization process. Valid values range from 0.05 to 0.25.</para>
        /// <para>正则化过程中使用的空间格网的精度。有效值范围为 0.05 到 0.25。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Precision")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _precision { get; set; } = 0.25;


        /// <summary>
        /// <para>Diagonal Penalty</para>
        /// <para>When the Right Angles and Diagonals method is used, this value dictates the likelihood of constructing right angles or diagonal edges between two adjoining segments. When the Any Angles method is used, this value dictates the likelihood of constructing diagonal edges that do not conform to the preferred edges determined by the tool's algorithm. If the penalty value is set to 0, the preferred edges will not be used, resulting in the production of a simplified irregular polygon. Generally, the higher the value, the less likely a diagonal edge will be constructed.</para>
        /// <para>当使用直角和对角线方法时，该值决定了在两个相邻线段之间构造直角或对角线边的可能性。使用“任意角度”方法时，此值决定了构造不符合工具算法确定的首选边的对角线的可能性。如果惩罚值设置为 0，则不会使用首选边，从而生成简化的不规则多边形。通常，该值越高，构造对角线边缘的可能性就越小。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Diagonal Penalty")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _diagonal_penalty { get; set; } = 1.5;


        /// <summary>
        /// <para>Minimum Radius</para>
        /// <para>The smallest radius allowed for a regularized circle. A value of 0 implies there is no minimum size limit. This option is only available with the Circle method.</para>
        /// <para>最小半径允许正则化圆。值为 0 表示没有最小大小限制。此选项仅适用于 Circle 方法。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Radius")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _min_radius { get; set; } = 0.1;


        /// <summary>
        /// <para>Maximum Radius</para>
        /// <para>The largest radius allowed for a regularized circular. This option is only available with the Circle method.</para>
        /// <para>最大半径允许正则化圆形。此选项仅适用于 Circle 方法。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Radius")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _max_radius { get; set; } = 1000000;


        public RegularizeBuildingFootprint SetEnv(object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object workspace = null)
        {
            base.SetEnv(extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, workspace: workspace);
            return this;
        }

    }

}